//package edu.cmu.cs.webapp.ioms.dao;
//import java.util.Iterator;
//import java.util.Properties;
////import orders.Customer;
////import orders.OrdersPackage;
//import org.eclipse.emf.common.util.TreeIterator;
//import org.eclipse.emf.ecore.EObject;
//import org.eclipse.emf.ecore.EPackage;
//import org.eclipse.emf.teneo.hibernate.HbDataStore;
//import org.eclipse.emf.teneo.hibernate.HbHelper;
//
//import org.hibernate.Query;
//import org.hibernate.Session;
//import org.hibernate.SessionFactory;
//import org.hibernate.Transaction;
//import org.hibernate.cfg.Environment;
//
//import edu.cmu.cs.webapp.ioms.models.Client;
//import edu.cmu.cs.webapp.ioms.models.IOMSPackage;
//import edu.cmu.cs.webapp.ioms.models.impl.IOMSPackageImpl;
//
//public class test {
//
//	/**
//	 * @param args
//	 */
//	public static void main(String[] args) {
//		// TODO Auto-generated method stub
//
//
//		        HbDataStore hbds = (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore("MyDb");
//
//		        final Properties props = new Properties();
//		        
//		        props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
//		        props.setProperty(Environment.URL, "jdbc:mysql://127.0.0.1:3306/webapp");
////		        props.setProperty(Environment.USER, "");
////		        props.setProperty(Environment.PASS, "");
//		        props.setProperty(Environment.DIALECT, org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
//		        props.setProperty(Environment.SHOW_SQL, "true");
//		  
//		        hbds.setProperties(props);
//
//		        hbds.setEPackages(new EPackage[]{IOMSPackageImpl.eINSTANCE});
//		        hbds.initialize();
//		        
//		        SessionFactory sessionFactory = hbds.getSessionFactory();
//		        Session session = sessionFactory.openSession();
//		        Transaction tx = session.getTransaction();
//		        tx.begin();
//		        
//		        Client client = IOMSPackage.eINSTANCE.getIOMSFactory().createClient();
//		        client.setCity("Shanghai");
//		        client.setAddress("abc");
//		        session.save(client);
//		        
////				Query query = session.createQuery("from Client where e_id= 5");
////				Iterator i = query.list().iterator();
//			
////				while(i.hasNext()){
////
////						EObject eo = (EObject)i.next();
////						System.out.println(eo);
////						session.delete(eo);
////				}
//				
////				while(i.hasNext()){
////
////					EObject eo = (EObject)i.next();
////					((Client)eo).setAddress("i love");
////					((Client)eo).setCompany("ver");
////					session.update(eo);
////				}
////				
////				query.executeUpdate();
//		
//						       
//		        tx.commit();
//		        session.close();
//	}
//
//}
